package cn.ainit.sys.ds.store;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Service;

import cn.ainit.butn.proceduce.CommonProcedure;
import cn.ainit.common.ReturnObject;
import cn.ainit.sys.framework.entity.SysColumns;
import cn.ainit.sys.framework.save.ReceiveZM;
import cn.ainit.sys.query.datastore.DataStore;

@Service("storeServiceImpl")
public class StoreServiceImpl implements StoreService {
	
	private StoreDao storeDao;
	
	@Resource
	public void setStoreDao(StoreDao storeDao) {
		this.storeDao = storeDao;
	}
	@Override
	public String findSql(String dsId) throws Exception {
		return storeDao.findSql(dsId);
	}
	@Override
	public DataStore findStore(String dsId) throws Exception {
		return storeDao.findStore(dsId);
	}
	@Override
	public Object findObjects(String sql) throws Exception {
		return storeDao.findObjects(sql);
	}
	@Override
	public Integer checkObject(String sql) throws Exception {
		return storeDao.checkObject(sql);
	}
	
	/**
	 *审核时根据主键得到对象的审核状态
	 * @throws Exception
	 * author:cff
	 * 2014/3/27 10:55
	 */
	@Override
	public Integer getIsVerify(String hql)throws Exception{
		return storeDao.getIsVerify(hql);
	}
	
	/***
	 * 作废时根据主键得到作废之前的状态
	 * @param hql
	 * @return
	 * @throws Exception
	 */
	@Override
	public Integer getIsDestory(String hql) throws Exception{
		return storeDao.getIsDestory(hql);
	}
	@Override
	public CommonProcedure procedureByDsId(String dsId,String code) throws Exception {
		return storeDao.procedureByDsId(dsId,code);
	}
	@Override
	public boolean updDestory(String dsId,String manId,String whereStr,String aord) throws Exception {
		return this.storeDao.updDestory(dsId,manId,whereStr,aord);
	}
	@Override
	public ReturnObject execProcedure(String djId,String dsId, String manId, String stationId,String proceName)
			throws Exception {
		return this.storeDao.execProcedure(djId,dsId,manId,stationId,proceName);
	}
	
	/**
	 * 根据sql返回单个的String类型的字符
	 * @param sql
	 * @return
	 * @throws Exception
	 */
	public String getStringBySql(String sql) throws Exception {
		return this.storeDao.getStringBySql(sql);
	}
	@Override
	public String execParentNode(String managerId) throws Exception {
		return this.storeDao.execParentNode(managerId);
	}
	@Override
	public List<String> callBackSql(String sqlText) throws Exception {
		return this.storeDao.callBackSql(sqlText);
	}
	@Override
	public boolean saveQueryCol(List<String> colnList, String dsId)
			throws Exception {
		return this.storeDao.saveQueryCol(colnList, dsId);
	}
	@Override
	public List execSql(String sql) throws Exception {
		return this.storeDao.execSql(sql);
	}
	@Override
	public ReturnObject saveConfig(Map<String,Object> receiveMobj)
			throws Exception {
		return this.storeDao.saveConfig(receiveMobj);
	}
}
